<%@ page language="java" import="java.util.*,com.wyb.moto.model.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
YouEr youer = (YouEr)request.getSession().getAttribute("user");
%>
<!DOCTYPE html>
<html>
    
    <head>
    	<base href="<%=basePath%>">
        <title>Forms</title>
        <!-- Bootstrap -->
        <link href="bootstrap/css/bootstrap.min.css" rel="stylesheet" media="screen">
        <link href="bootstrap/css/bootstrap-responsive.min.css" rel="stylesheet" media="screen">
        <link href="assets/styles.css" rel="stylesheet" media="screen">
        <!--[if lte IE 8]><script language="javascript" type="text/javascript" src="vendors/flot/excanvas.min.js"></script><![endif]-->
        <!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
        <!--[if lt IE 9]>
            <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
        <![endif]-->
        <script src="vendors/modernizr-2.6.2-respond-1.1.0.min.js"></script>
    </head>
    
    <body>
    
    <!-- 公共头部Header，除了登录界面，每个界面都加这一部分    start -->
        <div class="navbar navbar-fixed-top">
            <div class="navbar-inner">
                <div class="container-fluid">
                    <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse"> <span class="icon-bar"></span>
                     <span class="icon-bar"></span>
                     <span class="icon-bar"></span>
                    </a>
                    <a class="brand" href="#">幼儿园请假管理系统</a>
                    <div class="nav-collapse collapse">
                        <ul class="nav pull-right">
                            <li class="dropdown">
                                <a href="#" role="button" class="dropdown-toggle" data-toggle="dropdown"> <i class="icon-user"></i> <%=youer.getXm() %> <i class="caret"></i>
                                </a>
                                <ul class="dropdown-menu">
                                  
                                    <li>
                                        <a tabindex="-1" href="login.html">注销</a>
                                    </li>
                                </ul>
                            </li>
                        </ul>
                        <ul class="nav">
                            <li class="active">
                                <a href="#">请假</a>
                            </li>
                         
                        </ul>
                    </div>
                    <!--/.nav-collapse -->
                </div>
            </div>
        </div>
           <!-- 公共头部Header，除了登录界面，每个界面都加这一部分    start -->
           
           
           
         <!-- 注册页面 -->  
        <div class="container-fluid">
            <div class="row-fluid">
                
                <!--/span-->
                <div class="span9" id="content">
                      <!-- morris stacked chart -->
                    <div class="row-fluid">
                        <!-- block -->
                        <div class="block">
                            <div class="navbar navbar-inner block-header">
                            </div>
                            <div class="block-content collapse in">
                                <div class="span12">
                                     <form class="form-horizontal">
                                      <fieldset>
                                        <legend>请假</legend>
                                        <div class="control-group">
                                          <label class="control-label" for="focusedInput">幼儿编号</label>
                                          <div class="controls">
                                            <input readonly="true" value="<%=youer.getBh() %>" class="input-xlarge focused" id="focusedInput" type="text" >
                                          </div>
                                        </div>
                                        <div class="control-group">
                                          <label class="control-label" for="focusedInput">幼儿姓名</label>
                                          <div class="controls">
                                            <input readonly="true" value="<%=youer.getXm() %>" class="input-xlarge focused" id="focusedInput" type="text" >
                                          </div>
                                        </div>
                                        <div class="control-group">
                                          <label class="control-label" for="focusedInput">请假开始时间</label>
                                          <div class="controls">
                                            <input class="input-xlarge focused datepicker" id="kssj" type="text" >
                                          </div>
                                        </div>
                                        <div class="control-group">
                                          <label class="control-label" for="focusedInput">请假结束时间</label>
                                          <div class="controls">
                                            <input class="input-xlarge focused datepicker" id="jssj" type="text" >
                                          </div>
                                        </div>
                                        <div class="control-group">
                                          <label class="control-label" for="focusedInput">请假事由</label>
                                          <div class="controls">
                                            <input class="input-xlarge focused" id="qjsy" type="text" >
                                          </div>
                                        </div>
                                        
                                        <div class="form-actions">
                                          <button  class="btn btn-primary" onclick="save()">保存</button>
                                          <button type="reset" class="btn">取消</button>
                                        </div>
                                      </fieldset>
                                    </form>

                                </div>
                            </div>
                        </div>
                        <!-- /block -->
                    </div>

                </div>
            </div>
            <hr>
        </div>
        <!--/.fluid-container-->
        <link href="vendors/datepicker.css" rel="stylesheet" media="screen">
        <link href="vendors/uniform.default.css" rel="stylesheet" media="screen">
        <link href="vendors/chosen.min.css" rel="stylesheet" media="screen">

        <link href="vendors/wysiwyg/bootstrap-wysihtml5.css" rel="stylesheet" media="screen">

        <script src="vendors/jquery-1.9.1.js"></script>
        <script src="bootstrap/js/bootstrap.min.js"></script>
        <script src="vendors/jquery.uniform.min.js"></script>
        <script src="vendors/chosen.jquery.min.js"></script>
        <script src="vendors/bootstrap-datepicker.js"></script>

        <script src="vendors/wysiwyg/wysihtml5-0.3.0.js"></script>
        <script src="vendors/wysiwyg/bootstrap-wysihtml5.js"></script>

        <script src="vendors/wizard/jquery.bootstrap.wizard.min.js"></script>

	<script type="text/javascript" src="vendors/jquery-validation/dist/jquery.validate.min.js"></script>
	<script src="assets/form-validation.js"></script>
        
	<script src="assets/scripts.js"></script>
        <script>

	jQuery(document).ready(function() {   
	   FormValidation.init();
	});
	

        $(function() {
            $(".datepicker").datepicker();
            $(".uniform_on").uniform();
            $(".chzn-select").chosen();
            $('.textarea').wysihtml5();

            $('#rootwizard').bootstrapWizard({onTabShow: function(tab, navigation, index) {
                var $total = navigation.find('li').length;
                var $current = index+1;
                var $percent = ($current/$total) * 100;
                $('#rootwizard').find('.bar').css({width:$percent+'%'});
                // If it's the last tab then hide the last button and show the finish instead
                if($current >= $total) {
                    $('#rootwizard').find('.pager .next').hide();
                    $('#rootwizard').find('.pager .finish').show();
                    $('#rootwizard').find('.pager .finish').removeClass('disabled');
                } else {
                    $('#rootwizard').find('.pager .next').show();
                    $('#rootwizard').find('.pager .finish').hide();
                }
            }});
            $('#rootwizard .finish').click(function() {
                alert('Finished!, Starting over!');
                $('#rootwizard').find("a[href*='tab1']").trigger('click');
            });
        });
        </script>
        <script>
        	function save(){
        		var kssj = $("#kssj").val();
        		var jssj = $("#jssj").val();
        		var qjsy = $("#qjsy").val();
        		if(kssj==''){
        			alert("开始时间为空!");
        			return;
        		}
        		if(jssj==''){
        			alert("结束时间为空!");
        			return;
        		}
        		if(qjsy == ''){
        			alert("请假事由为空！");
        			return;
        		}
        		var params = new Object();
    			params.kssj = kssj;
    			params.jssj = jssj;
    			params.qjsy=qjsy;
    			$.ajax({
    				type: "POST",
    				url: 'logincontroller/saveQj.htmls',
    				data: params,
    				async: false,
    				cache: false,
    				dataType: 'json',
    				success: function (data) {
    					if(data.code != 200){
    						alert(data.errorMessage);
    						return;
    					}else{
    						alert("请假成功！");
    					}
    					
    				}
    			});
        		
        	}
        	
        </script>
    </body>

</html>
